
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登陆</title>
 <script type="text/javascript" src="js/jquery.fullPage.min.js"></script>
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script>
function login(){
    var name = $("#username").val();
    var pwd=$("#pwd").val();
    if(name==""||pwd==""){
        alert("账号或密码不能为空");
        return;
    }
   // var param = JSON.stringify({'userName': name,'password':pwd});
    $.ajax({
        cache: false,
        type: "POST",
        url:"servlet/LoginServlet",
        dataType: "json",
        data:$('#loginForm').serialize(),
        async: true,
        success: function(data){
            if(data.success=="true"){
            	alert("hah");
               location.href = "NewFile.html?user="+$("#username").val();
            }else {
                var msg = data.errorCode.msg;
                $('#msg').html(msg);
            }
        }
    });
}

</script>
</head>
<body>
            <div class="dengL_div" style="z-index: 2;">
                <form id="loginForm">
                    <div  role="alert" id="msg" >

                    </div>
                    <div class="form_input_div">
                        <div class="input_yongHM">
                            <span class="yongHM_no" style="">用户名</span>
                            <input type="text" placeholder="用户名" id="username" name="user.name">
                        </div>
                        <div class="input_miM">
                            <span class="miM_no">密码</span>
                            <input type="password" placeholder="密码" id="pwd" name="user.pwd">
                        </div>
                        <div class="zhangHfW">
                            <a href="#" style="float: right;" name="zhaoHuiMiMa">找回密码 </a>
                        </div>
                    </div>
                    <div class="dl_button">
                        <a href="#" onclick="login()">登陆</a>
                    </div>
                </form>
            </div>
</body>

</html>

